<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" lang="zh">
<head>
    <meta charset="UTF-8">
    <title>编辑学生</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            background-color: #f4f4f4;
            margin: 0;
            padding: 20px;
        }
        h1 {
            color: #333;
            text-align: center;
        }
        form {
            background-color: #fff;
            padding: 20px;
            box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
            max-width: 400px;
            margin: 0 auto;
        }
        label {
            display: block;
            margin-bottom: 8px;
            font-weight: bold;
        }
        input[type="text"], input[type="number"] {
            width: 100%;
            padding: 8px;
            margin-bottom: 15px;
            border: 1px solid #ddd;
            border-radius: 4px;
        }
        input[type="submit"] {
            background-color: #007bff;
            color: white;
            padding: 10px 20px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
        }
        input[type="submit"]:hover {
            background-color: #0056b3;
        }
        a {
            display: block;
            margin-top: 20px;
            color: #007bff;
            text-decoration: none;
            text-align: center;
        }
        a:hover {
            text-decoration: underline;
        }
    </style>
</head>
<body>
<h1>编辑学生</h1>

<form th:action="@{/student/update}" method="post">
    <input type="hidden" name="id" th:value="${student.id}" />
    <label for="studentname">姓名:</label>
    <input type="text" id="studentname" name="studentname" th:value="${student.studentname}" required/>

    <label for="gender">性别:</label>
    <input type="text" id="gender" name="gender" th:value="${student.gender}" required/>

    <label for="age">年龄:</label>
    <input type="number" id="age" name="age" th:value="${student.age}" required/>

    <input type="submit" value="更新学生信息" />
</form>

<a href="/student">返回学生列表</a>
</body>
</html>
